import {Component} from '@angular/core';
import {App, IonicPage, NavController} from 'ionic-angular';
import {PublicService} from "../../common/public.service";

/**
 * 系统设置
 */

@IonicPage()
@Component({
  selector: 'page-system-set',
  templateUrl: 'system-set.html',
})
export class SystemSetPage {

  constructor(public navCtrl: NavController,
              private pub: PublicService, private app: App) {
  }

  ionViewDidLoad() {
  }

  /**
   * 清除应用缓存
   */
  cleanStorage() {
    this.pub.presentConfirm("确定清除应用缓存数据吗？").then(() => {
      localStorage.clear();
      sessionStorage.clear();
      setTimeout(() => {
        this.app.getRootNav().setRoot("LoginPage");
      }, 2000);
    });
  }
}
